<?php
$HTMLstr .= '<div class="body">
    <div class="findOne">
    <div class="findOneInside">';

if (!empty($this->message)) {
    $HTMLstr .= '<div class="head">
        '.$this->message.'
            </div>';
}

$HTMLstr .= '<form action="?controller=user&action=save" method="post" enctype=multipart/form-data>
    <div class="head">
    Изменение пароля
    </div>

    <div class="head">
    Старый пароль:
    </div>
    
     <div class="fetchallOne" id="frame">
     <textarea cols="30" rows="1" name="password"></textarea>
     </div>

     <div class="head">
     Новый пароль:
     </div>

    <div class="fetchallOne" id="frame">
          <textarea cols="30" rows="1" name="newpassword"></textarea>
          </div>
          
        <div class="head">
        Повторите новый пароль:
        </div>

        <div class="fetchallOne" id="frame">
          <textarea cols="30" rows="1" name="newrpassword"></textarea>
          </div>

<div class="head">
Личные данные
</div>

<div class="head">
Имя:
</div>

<div class="fetchallOne" id="frame">
<textarea cols="30" rows="1" name="name">'. $this->oneModel->getName() .'</textarea>
    </div>

<div class="head">
Фамилия:
</div>

<div class="fetchallOne" id="frame">
<textarea cols="30" rows="1" name="surname">'. $this->oneModel->getSurname() .'</textarea>
    </div>

<div class="head">
Возраст: <select name="age">
    <option value="0">Не важно</option>';
for ($i=16;$i<61;$i++) {
    $HTMLstr .= '<option value="'. $i .'"';
    if($this->oneModel->getAge() == $i){
     $HTMLstr .= 'SELECTED';
    }
    $HTMLstr .= '>'. $i .'</option>';
}
$HTMLstr .= '</select>
    </div>

<div class="head">
О себе:
</div>

<div class="fetchallOne" id="frame">
<textarea cols="30" rows="3" name="about">'. $this->oneModel->getAbout() .'</textarea>
    </div>
    
<div class="head">
Аватар:
</div>';
if (!empty ($this->allImgs)){

foreach($this->allImgs as $oneImg) {
    $HTMLstr .= '<div class="fetchallOne" id="imgavat">
        <input type="radio"';
    if($this->oneModel->getAvatar() == $oneImg->getId()) {
        $HTMLstr .= 'CHECKED';
    }
    $HTMLstr .= ' name="avatar" value="'. $oneImg->getId() .'">
        <div class="fetchallOneInsideAvatar">
        <img height="100%" src="stuff/images/saved/'. $oneImg->getName() .'.jpg">
            </div>
            </div>';
}
    } else {
        $HTMLstr .= '<div class="fetchallOne" id="frame">
            <input type="file" name="file">
            </div>';
    }
    $HTMLstr .= '<input type="hidden" name="id" value="'. $this->oneModel->getId() .'">
<div class="fetchallOne" id="frame">
<input type="submit" value="Сохранить">
      </div>
    </form>
    </div>
        </div>
        </div>';